<% content_for :title do %>
  <label>Search for matching words</label>
<% end %>

<% remote_form_for :word, Word.new, :url => look_up_words_path,
                    :loading => "#{update_page {|page| page.show(:progress_bar)}}",
                    :complete => "#{update_page {|page| page.hide(:progress_bar)}}" do |f| %>
  <p>
    <%= f.label :text %>
    <%= text_field_with_auto_complete :word, :text, {}, :indicator => 'progress_bar' %>
  </p>

  <p>
    <%= label_tag :strategy_id, 'Strategy' %>
    <%= select_tag('strategy_id', options_for_select(Strategy.to_dropdown)) %>
  </p>

  <p>    
    <%= radio_button_tag :view_all, :false, true %>
    <%= label_tag :first_5_results %>
    <br>
    <%= radio_button_tag :view_all, :true %>
    <%= label_tag :view_all %>
  </p>

  <p>
    <%= f.submit 'Look-up' %>
    <span id="progress_bar" style="display:none;">
      <%= image_tag('progress_bar.gif', :border => 0, :width => 120) %>
    </span>
  </p>
<% end %>

<ul id="matches"></ul>